package com.qidian.mes.pro.controller;

import com.qidian.mes.pojo.pro.ProRoute;
import com.qidian.mes.pojo.pro.ProRouteProcess;
import com.qidian.mes.pojo.pro.ProRouteProduct;
import com.qidian.mes.pro.service.ProRouteProductService;
import com.qidian.mes.util.pojo.MESResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 郭靖旖
 * @Company
 * @Time 2023/11/5 14:07
 * @Description
 **/
@RestController
@CrossOrigin
@RequestMapping("/routeProduct")
public class ProRouteProductController {
    @Autowired
    ProRouteProductService proRouteProductService;
    @GetMapping("/get")
    public MESResult get(int page, int limit, Long routeId){
        return proRouteProductService.selectByrouteId(page,limit,routeId);
    }
    @DeleteMapping("/deleteRouteProduct")
    public MESResult deleteRouteProduct(Long recordId){
        return proRouteProductService.deleteRouteProduct(recordId);
    }
    @PostMapping("/save")
    public MESResult save(@RequestBody ProRouteProduct proRouteProduct){
        System.out.println(proRouteProduct);
        return proRouteProductService.save(proRouteProduct);
    }
    @PostMapping("/update")
    public MESResult update(@RequestBody ProRouteProduct proRouteProduct){
        return proRouteProductService.update(proRouteProduct);
    }
    @GetMapping("/list")
    public MESResult selectByPage(int page, int limit,ProRouteProduct proRouteProduct){
        return proRouteProductService.selectByPage(page,limit,proRouteProduct);
    }
}
